﻿/// <reference path="BaseControl.js" />
/// <reference path="EventDefinition.js" />
/// <reference path="../Turbo/ServerEventSender.js" />

var $BaseComplexControl = TA.Turbo.Controls.BaseComplexControl = function BaseComplexControl(clientId)
{
	if (Function.IsInherit(arguments)) return;

	this.BaseControl(clientId);
	this.ServerEventSender();
}
$BaseComplexControl.Inherit(TA.Turbo.Controls.BaseControl);
$BaseComplexControl.Inherit(TA.Turbo.Common.ServerEventSender);

$BaseComplexControl.prototype._eventDefinitions = new Object();

var ____a;
if (____a)
{
	$BaseComplexControl.prototype = new $BaseControl();
	$BaseComplexControl.prototype.BaseControl = new $BaseControl();
	$BaseComplexControl.prototype.ServerEventSender = new $ServerEventSender();

	$BaseComplexControl.prototype._control = document.getElementById("asd");
	$BaseComplexControl.prototype._properties = new Object();
	$BaseComplexControl.prototype._propertyDefinitions = new Object();
}

TA.Turbo.Controls.BaseComplexControl.DefineEvent = function DefineEvent(eventDef)
{
	this.prototype._eventDefinitions[eventDef._name] = eventDef;
}

TA.Turbo.Controls.BaseComplexControl.prototype.Init = function Init()
{
	this.BaseControl.Init.call(this);
	for (var eventName in this._eventDefinitions)
	{
		var eventDef = this._eventDefinitions[eventName];

		eventDef.Init(this);
	}
}

